import java.util.Random;
import java.util.Scanner;

/**
 * Created by abdulazizalonizi on 7/29/17.
 */
public class Task4 {
    public static void main (String [] args)
    {
        Random rand = new Random();

        int arr1 [] = new int [15];
        for (int i =0 ; i <arr1.length ; i++)
        {
            arr1[i] = rand.nextInt(30);
            System.out.print(arr1[i] +",");
        }

        Scanner kb = new Scanner(System.in);
        System.out.println("\nenter a key to search for ");
        int key = kb.nextInt();
        boolean flag = false ;

        for (int i =0 ; i <arr1.length ; i++)
        {
            if (key == arr1[i])
            {
                System.out.println("key found !");
                flag = true ;
            }


        }
        if (flag == false)
            System.out.println("key was not found!");









    }
}
